<template>
    <div>

        <van-nav-bar :fixed='true' left-arrow @click-left="onClickLeft"></van-nav-bar>
         <div class="radd">
            <van-icon name="user-circle-o" size="80px" color="#ccc" />
        </div>
<div class="note">
        <span style="float:left;font-size:16px">手机号登录</span>
</div>

    <input type="text" placeholder="请输入用户名"  v-model='username' class="ript">
    <input type="text" placeholder="请输入密码" v-model="password" class="ript">

<div class="rlogin" @click="amend()">登录</div>
    </div>
</template>
<script>
import axios from 'axios'
export default {
    data(){
        return{
            username:'',
            password:'',
        }
    },
    methods:{
         onClickLeft() {
            this.$router.go(-1)
        },
        amend(){
             
              axios({
                method: "get",
                url:"http://jx.xuzhixiang.top/ap/api/login.php",
                params:{username:this.username,password:this.password} 
                }).then(data => {
                     console.log(data);
                     if(data.data.code==1){
                       this.$router.push('/zyfb')
                     }else{
                         alert('用户名或者密码错误')
                     }
                });  
        }
    }
}

</script>

<style scoped>
.radd{
    width: 105px;
    height: 105px;
    margin:46px auto  0;
    }
.note{
    width: 200px;
    height: 16px;
    margin: 20px auto 30px;
    line-height: 16px
}
.rlogin{
    width: 280px;
    height: 50px;
    margin: 30px auto 0;
    border: 1px solid #ccc;
    line-height: 50px;
   background:#26a2ff;
    color: #fff;
    font-size: 16px;
}
.ript{
    width: 280px;
    height: 50px;
    text-align: center;
    margin-bottom: 20px
}

</style>